import java.util.Scanner;

/**
 * 连续输入字符串，请按长度为8拆分每个字符串后输出到新的字符串数组；
 *长度不是8整数倍的字符串请在后面补数字0，空字符串不处理。
 * Created by JiaJia on 2019/6/19 0019.
 */
public class HuaWei004 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            StringBuilder sb=new StringBuilder();
            String str=scanner.nextLine();
            stringSplit(sb,str);
            str=scanner.nextLine();
            stringSplit(sb,str);
            System.out.println(sb.toString());
        }
        scanner.close();
    }

    private static void stringSplit(StringBuilder sb,String s){
        if (s==null)
            return ;
        int pos=8;
        while (pos<s.length()){
            sb.append(s.substring(pos-8,pos)).append("\n");
            pos+=8;
        }
        if (pos>s.length()){
            sb.append(s.substring(pos-8,s.length()));
            for (int i = s.length(); i <pos ; i++) {
                sb.append(0);
            }
            sb.append("\n");
        }
    }
}